"Working on Home Screen backend with BLoC Architecture"
This week I learned BLoC Architecture in Flutter, I understood it quickly from YouTube videos. I started implementing it in App.
I will try to explain first what BLOC components should do as short as possible (and as trivial as possible).
UI screen - obviously shows data to the user
BLOC (or the ViewModel) - decides HOW to display data to the user, do we make the text bold, do we show the error, do we go to next screen.
Repo - decides WHAT data to display to the user (do we show the content from db, do we fetch it from API)
I have created BLoC for home screen & location services, I have done the following tasks in Home screen
Fetched & Displayed User Location using Geolocator Package App will ask for location permission & will access location of user, I have used two packages
location - For asking GPS Permission
GeoLocator - For Getting coordinates of user location
Fetched Nearby Hospitals using Overpass API
Used Overpass API for Getting Nearby Hospitals, I have to pass Location Coordinates & radius to get hospitals around my Location
Then I Parsed JSoN data recieved to list of objects
Fetching Image of each hospital from Google
Using Shimmer Loading Effect to load list
Completed Main functionality of SQL Database class
Scraped CDM of Indiana State
I have used shared pref to store some data, I will replace it with Hive
I will use sqflite to store CDM
Working on Main Feature of this App [ Compare Prices Screen]
Scraping CDM of New York State